﻿
#include "graphics_def.h"
#include <enum_parser.h>

namespace ifire {

const DirectX::XMFLOAT4X4 IDENTITY_4X4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
    0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
const DirectX::XMFLOAT3X3 IDENTITY_3X3(
    1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
const DirectX::XMFLOAT3X3 ZERO_3X3(
    0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);

const DirectX::XMMATRIX ZERO_MAT(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
    0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
const DirectX::XMMATRIX ID_MAT = DirectX::XMMatrixIdentity();

const DirectX::XMVECTOR SCALE1 = DirectX::XMVectorSet(1.0f, 1.0f, 1.0f, 0.0f);

const DirectX::XMVECTOR VEC0 = DirectX::XMVectorZero();
const DirectX::XMVECTOR ID_QUAT = DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 1.0f);
const DirectX::XMVECTOR VEC_EPSILON = DirectX::XMVectorReplicate(F_EPSILON);

IAxis ParseIAxis(ikit::sstr name, IAxis default_value) {
  static std::pair<ikit::sstr, IAxis> enums[] = {
      {"X", IAxis::X}, //
      {"Y", IAxis::Y}, //
      {"Z", IAxis::Z}  //
  };
  static ikit::EnumParser<IAxis> parser(enums, (int)IAxis::Z + 1);
  return parser.Get(name, default_value);
}

} // namespace ifire